package indi.yudidi;

import indi.yudidi.classloader.MyClassLoader;

public class TestMyClassLoader
{
    public static void main(String[] args) throws Exception
    {
//        indi.yudidi.classloader.MyClassLoader mcl = new indi.yudidi.classloader.MyClassLoader();
        MyClassLoader mcl = new MyClassLoader(ClassLoader.getSystemClassLoader().getParent());//父加载器是:ExtClassLoader,加载jdk/lib/ext目录
        Class<?> c1 = Class.forName("indi.yudidi.Person", true, mcl);
        Object obj = c1.newInstance();
        System.out.println(obj);
        System.out.println(obj.getClass());
        System.out.println(obj.getClass().getClassLoader());
    }

}